package com.example.demo.service.impl;


import com.example.demo.domain.entity.VojLanguages;
import com.example.demo.dto.ItemDto;
import com.example.demo.mapper.CompanyMapper;
import com.example.demo.mapper.VojLanguagesMapper;
import com.example.demo.mapper.VojProblemCategoriesMapper;
import com.example.demo.mapper.VojProblemTagsMapper;
import com.example.demo.service.CommonService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.*;

@Service
@Transactional
public class CommonServiceImpl implements CommonService {

    @Resource
    private VojLanguagesMapper vojLanguagesMapper;
    @Resource
    private CompanyMapper companyMapper;
    @Resource
    private VojProblemCategoriesMapper categoriesMapper;
    @Resource
    private VojProblemTagsMapper tagsMapper;

    @Override
    public List<ItemDto> getLanguage() {
        List<ItemDto> result = vojLanguagesMapper.getAllLanguage();
        return result;
    }

    @Override
    public List<ItemDto> getCompany() {
        List<ItemDto> result = companyMapper.getAllCompany();
        return result;
    }

    @Override
    public List<ItemDto> getCategory() {
        List<ItemDto> result = categoriesMapper.getAllCategory();
        return result;
    }

    @Override
    public List<ItemDto> getTag() {
        List<ItemDto> result = tagsMapper.getAllTag();
        return result;
    }
}

